package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import flash.utils.getDefinitionByName;
	import flash.utils.getTimer;
	
	public class Test extends Sprite
	{
		private var textField:TextField;
		public function Test()
		{
			addEventListener(Event.ADDED_TO_STAGE,onAddToStage);
			
			textField = new TextField();
			textField.text = "as创建的文本框1";
			textField.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN,onRightMouseDown);
			addChild(textField);
			var textField2:TextField = new TextField();
			textField2.text = "as创建的文本框2";
			textField2.y = 100;
			addChild(textField2);
			trace(getDefinitionByName("flash.text::TextField"));
		}
		private function onAddToStage(event:Event):void
		{
			trace("应用初始化完成");
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
		}
		private function onRightMouseDown(event:MouseEvent):void
		{
			x += 100;
			trace("鼠标右键按下");
			trace(getTimer());
		}
	}
}